﻿<html>
  <head>
    <meta name="generator" content="h-smile:richtext"/>
    <style>
      dl {margin-left:3em;}
      dt {margin-top:1em; margin-bottom:1em;}
    </style>
  </head>
<body>
  <h1>IAccessible and UI automation testing.</h1>
  <p>Sciter2 implements IAccessible in the way compatible with conventional browsers so UI automation tools based on IAccessible should work with Sciter based UI out of the box.</p>
  <p>To simplify UI tests scripting it has few extensions listed below:</p>
  <dl>
    <dt><code>HRESULT IAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChild);</code></dt>
    <dd>the <i>varChild</i> may accept strings passed as <code>VARIANT(VT_BSTR,str)</code>. &nbsp;The <i>str</i> is interpreted as a selector and if matching element is found its IAccessible wrapper gets returned in <code>ppdispChild</code>. That is equivalent of Element.select(selector) method in script. </dd>
    <dt><code>HRESULT IAccessible::get_accValue(VARIANT varChild, BSTR *pszValue);</code></dt>
    <dd>If <code>varChild</code> here holds negative int (VT_I4) then it gets interpreted as an index of attribute and the method returns corresponding attribute value. -1 - first attribute. -2 - second, etc. And if <code>varChild</code> holds string (VT_BSTR) then it gets interpreted as a name of attribute and the method returns corresponding attribute value.</dd>
    <dt><code>HRESULT IAccessible::get_accName(VARIANT varChild, BSTR *pszValue);</code></dt>
    <dd>If <code>varChild</code> here holds negative int (VT_I4) then it gets interpreted as an index of attribute and the method returns corresponding attribute value.</dd>
    <dt><code>HRESULT IAccessible::get_accState( VARIANT varChild, VARIANT *pvarState);</code></dt>
    <dd>If <code>varChild</code> here holds -1 (VT_I4) then the method returns number of attributes defined on element as <code>VARIANT(VT_I4,nAttributes)</code></dd></dl>
  <p>Standard parameter values and other IAccessible methods work as defined IAccessible documentation. </p>
  <p></p>
</body>
</html>